package com.example.demo.mapper;

import com.example.demo.model.ReceivingAddress;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;

@Mapper
public interface ReceivingAddressMapper {
    // 添加收货地址
    int insert(ReceivingAddress address);
    
    // 获取用户的所有收货地址
    List<ReceivingAddress> selectByUserId(Integer userId);
    
    // 获取默认收货地址
    ReceivingAddress selectDefaultAddress(Integer userId);
    
    // 更新收货地址
    int update(ReceivingAddress address);
    
    // 删除收货地址
    int delete(Integer id);
    
    // 将所有地址设置为非默认
    int clearDefault(Integer userId);
} 